<?php
/**
  * @Author     liangjinying
  * @Date       2015-1-14
  * @Encoding   UTF-8
  * Descript    Please Type In
  **/
class GameTraceService extends Service{
	
	public static function getHeader($params){
		
		$UserLogin = array(
				'RecDate'     => array('text' => PubFunc::t('日期')),
				'LoginUser'   => array('text' => PubFunc::t('登录人数'), 'rule' => 'numeric'),
                'FirstLoginUser7Days'   => array('text' => PubFunc::t('历史总登陆人数'), 'rule' => 'numeric'),
				'Login1Day'   => array('text' => PubFunc::t('次日登录'),'rule'=>'numeric'),
				'Login3Day'   => array('text' => PubFunc::t('3日登录'),'rule'=>'numeric'),
				'Login7Day'   => array('text' => PubFunc::t('7日登录'),'rule'=>'numeric'),
				'Login14Day'  => array('text' => PubFunc::t('14日登录'),'rule'=>'numeric'),
				'Login30Day'  => array('text' => PubFunc::t('30日登录'),'rule'=>'numeric')
		);
		
		$PayTimes  = array(
				'RecDate' 	  => array('text' => PubFunc::t('日期')),
				'Pay1'	  	  => array('text' => PubFunc::t('1次付费'),'rule'=>'numeric'),
				'Pay2'	  	  => array('text' => PubFunc::t('2次付费'),'rule'=>'numeric'),
				'Pay3'	  	  => array('text' => PubFunc::t('3次付费'),'rule'=>'numeric'),
				'Pay5'	  	  => array('text' => PubFunc::t('5次付费'),'rule'=>'numeric'),
				'Pay10'	  	  => array('text' => PubFunc::t('10次付费'),'rule'=>'numeric'),
				'Pay10Plus'	  => array('text' => PubFunc::t('10次以上付费'),'rule'=>'numeric'),				
				'PayMoney'	  => array('text' => PubFunc::t('当天累计付费'),'rule'=>'numeric'),				
		);

        if($params['kpi'] != 'CrossUser'){
            unset($UserLogin['FirstLoginUser7Days']);
        }
        $header = array('loginSta' => $UserLogin, 'paySta' => $PayTimes);

		return $header[$params['funStati']];		

	}
	
	public static function getTableData($params, $header){
		$field  = array_keys($header);
		$result = ModGameLoginTrace::indexData($params, $field);
		
		return $result;
	}
	
}